package main

import (
	"google.golang.org/grpc"
	"log"
	pb "grpc-hello/reservation"
	context "golang.org/x/net/context"
)

const serverAddr  = "localhost:50011"

func main()  {
	conn, err := grpc.Dial(serverAddr, grpc.WithInsecure())
	if err != nil {
		log.Fatalf("did not connect: %v", err)
	}
	defer conn.Close()

	c := pb.NewRoomReservationClient(conn)

	r, err := c.SayHello(context.Background(), &pb.HelloRequest{Name: "huayun321"})
	if err != nil {
		log.Fatalf("could not greet: %v", err)
	}
	log.Printf("Greeting: %s", r.Message)
}

